From: Andrew Cooper Date: Fri, 29 Jan 2021 10:32:18 +0000 (+0000) Subject: x86/svm: Reimplement VMRUN/STGI/CLGI with new asm-defns.h infrastructure X-Git-Tag: archive/raspbian/4.16.0+51-g0941d6cb-1+rpi1~2^2~42^2~1007 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=9a0d5c6e04bfa742401598d5c41c10943109f83d;p=xen.git x86/svm: Reimplement VMRUN/STGI/CLGI with new asm-defns.h infrastructure ... in order to reuse stgi elsewhere. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- diff --git a/xen/arch/x86/hvm/svm/entry.S b/xen/arch/x86/hvm/svm/entry.S index 1d2df08e89..e208a4b32a 100644 --- a/xen/arch/x86/hvm/svm/entry.S +++ b/xen/arch/x86/hvm/svm/entry.S @@ -22,10 +22,6 @@ #include #include -#define VMRUN .byte 0x0F,0x01,0xD8 -#define STGI .byte 0x0F,0x01,0xDC -#define CLGI .byte 0x0F,0x01,0xDD - ENTRY(svm_asm_do_resume) GET_CURRENT(bx) .Lsvm_do_resume: @@ -82,9 +78,9 @@ __UNLIKELY_END(nsvm_hap) pop %rsi pop %rdi - CLGI + clgi sti - VMRUN + vmrun SAVE_ALL @@ -93,7 +89,7 @@ __UNLIKELY_END(nsvm_hap) SPEC_CTRL_ENTRY_FROM_HVM /* Req: b=curr %rsp=regs/cpuinfo, Clob: acd */ /* WARNING! `ret`, `call *`, `jmp *` not safe before this point. */ - STGI + stgi GLOBAL(svm_stgi_label) mov %rsp,%rdi call svm_vmexit_handler diff --git a/xen/include/asm-x86/asm-defns.h b/xen/include/asm-x86/asm-defns.h index 43f4868d40..2e3ec0ac01 100644 --- a/xen/include/asm-x86/asm-defns.h +++ b/xen/include/asm-x86/asm-defns.h @@ -8,6 +8,18 @@ .endm #endif +.macro vmrun + .byte 0x0f, 0x01, 0xd8 +.endm + +.macro stgi + .byte 0x0f, 0x01, 0xdc +.endm + +.macro clgi + .byte 0x0f, 0x01, 0xdd +.endm + .macro INDIRECT_BRANCH insn:req arg:req /* * Create an indirect branch. insn is one of call/jmp, arg is a single